package com.hua.designpattern.creational.singleton;

/**
 * 
 * @author joshua
 * 
 *         线程安全，延迟加载
 *
 */
public class SingletonSafe {

	private static SingletonSafe instance = null;

	private SingletonSafe() {
	}

	public static SingletonSafe getInstance() {
		if (instance == null) {
			synchronized (Singleton.class) {
				if (instance == null) {
					instance = new SingletonSafe();
				}
			}
		}
		return instance;
	}
}
